<form class="layui-form layui-form-pane" method="post">
  <div class="layui-form-item">
    <label class="layui-form-label">菜单名称</label>
    <div class="layui-input-block">
      <input type="text" name="token" lay-verify="token" autocomplete="off" placeholder="请输入token" class="layui-input" value="123456" style="background-image: none; background-position: 1026px 0px; background-repeat: repeat repeat; ">
    </div>
  </div>
<div class="layui-form-item">
    <label class="layui-form-label">单选框</label>
    <div class="layui-input-block">
      <input type="radio" name="sex" value="男" title="男" checked="">
      <input type="radio" name="sex" value="女" title="女">
      <input type="radio" name="sex" value="禁" title="禁用" disabled="">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">APPID</label>
    <div class="layui-input-block">
      <input type="text" name="appid" lay-verify="appid" placeholder="请输入APPID" autocomplete="off" class="layui-input" value="wx79ef72b1f4978d23">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">APPSECRET</label>
    <div class="layui-input-block">
      <input type="tel" name="appsecret" lay-verify="appsecret" autocomplete="off" class="layui-input" value="5d3f1d6e2965db51f425c29cbc53fc55">
    </div>
  </div>
  <div class="layui-form-item ">
    <label class="layui-form-label">encodingaeskey</label>
    <div class="layui-input-block">
      <input type="text" name="encoding" lay-verify="encoding" autocomplete="off" class="layui-input" value="YKphjLBclfgZtrrBiKmutuUIdMEGPyjAUiYgdvwWhSO">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="submit_wx_config">立即提交</button>
      
    </div>
  </div>
</form>
<script>
layui.use('form', function(){
  var form = layui.form()
  ,layer = layui.layer
  
  //创建一个编辑器
  
  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });
  
  
  
  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });
  
  
});
</script>
